<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" 
	xmlns:sec="http://www.thymeleaf.org/extras/spring-security">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <!-- 避免IE使用兼容模式 -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
    <meta name="renderer" content="webkit">
    
    <!-- TopJUI框架样式 -->
    <link type="text/css" href="/topjui/themes/default/topjui.core.min.css" rel="stylesheet">
    <link type="text/css" href="/topjui/themes/default/topjui.blue.css" rel="stylesheet" id="dynamicTheme"/>
    <!-- FontAwesome字体图标 -->
    <link type="text/css" href="/static/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet"/>
    <!-- layui框架样式 -->
    <link type="text/css" href="/static/plugins/layui/css/layui.css" rel="stylesheet"/>
    <!-- iconfont字体图标 -->
	<link type="text/css" href="/static/plugins/iconfont/iconfont.css" rel="stylesheet"/>
    
    <!-- jQuery相关引用 -->
    <script type="text/javascript" src="/static/plugins/jquery/jquery.min.js"></script>
    <script type="text/javascript" src="/static/plugins/jquery/jquery.cookie.js"></script>
    <!-- TopJUI框架配置 -->
    <script type="text/javascript" src="/static/public/js/topjui.config.js"></script>
    <!-- TopJUI框架核心-->
    <script type="text/javascript" src="/topjui/js/topjui.core.min.js"></script>
    <!-- TopJUI中文支持 -->
    <script type="text/javascript" src="/topjui/js/locale/topjui.lang.zh_CN.js"></script>
    <!-- layui框架js -->
    <script type="text/javascript" src="/static/plugins/layui/layui.js" charset="utf-8"></script>
</head>

<body>
	<div sec:authorize="hasAuthority('system:log_operate')" data-toggle="topjui-layout" data-options="fit:true">
		<div sec:authorize="hasAuthority('system:log_operate:list')" data-options="region:'center',title:'',split:true,border:false,bodyCls:'border_right'">
			<table data-toggle="topjui-datagrid" data-options="
				id:'system-log_operate-list',url:'/system/log_operate/list',
				fitColumns:true,singleSelect:true,selectOnCheck:false,checkOnSelect:false,pageSize:50">
				<thead>
					<tr>
						<th data-options="field:'id',title:'ID',checkbox:true"></th>
						<th data-options="field:'label',title:'日志标签',width:80"></th>
						<th data-options="field:'message',title:'日志信息',width:180"></th>
						<th data-options="field:'operateType',title:'操作类型',width:80,hidden:true,
							formatter:function(value,row,index){
								if (value == 'ADD') {
									return '新增';
								} else if (value == 'EDIT') {
									return '编辑';
								} else if (value == 'DELETE') {
									return '删除';
								} else if (value == 'OTHER') {
									return '其他';
								} else {
									return '';
								}
							}"></th>
						<th data-options="field:'operatorType',title:'操作用户类型',width:80,hidden:true,
							formatter:function(value,row,index){
								if (value == 'MANAGE') {
									return '后台用户';
								} else if (value == 'MOBILE') {
									return '手机端用户';
								} else if (value == 'OTHER') {
									return '其他用户';
								} else {
									return '';
								}
							}"></th>
						<th data-options="field:'requestUrl',title:'请求URL',width:150"></th>
						<th data-options="field:'requestMethod',title:'请求方式',width:60"></th>
						<th data-options="field:'requestParams',title:'请求参数',width:100,hidden:true"></th>
						<th data-options="field:'ajaxResult',title:'返回结果',width:100,hidden:true"></th>
						<th data-options="field:'exceptionMsg',title:'异常信息',width:100,hidden:true"></th>
						<th data-options="field:'ipAddr',title:'IP地址',width:120"></th>
						<th data-options="field:'status',title:'状态',width:80,
							formatter:function(value,row,index){
								if (value == '0') {
									return '<label style=\'color: green;\'>操作成功</label>';
								} else if (value == '1') {
									return '<label style=\'color: red;\'>操作失败</label>';
								} else {
									return '';
								}
							}"></th>
						<th data-options="field:'operateUser',title:'操作用户',width:80"></th>
						<th data-options="field:'operateTime',title:'操作时间',width:130"></th>
					</tr>
				</thead>
			</table>
		</div>
	</div>
	
	<!-- 表格工具栏 -->
	<div sec:authorize="hasAuthority('system:log_operate:list')" id="system-log_operate-list-toolbar" class="topjui-toolbar" data-options="grid:{type:'datagrid', id:'system-log_operate-list'}">
		<a sec:authorize="hasAuthority('system:log_operate:add')" href="javascript:void(0)" data-toggle="topjui-menubutton" data-options="
			method:'openDialog',
			extend:'#system-log_operate-list-toolbar',
			iconCls:'fa fa-plus',
			dialog:{
  				id:'system-log_operate-add-dialog',
				title:'新增操作日志',
				href:'/system/log_operate/add_view',
				width:'60%',
				height:'60%',
				buttonsGroup:[{
					text:'确定',
					url:'/system/log_operate/add',
					iconCls:'fa fa-plus',
					handler:'ajaxForm',
					btnCls:'topjui-btn-green'
				}]
			}">新增</a>
		
		<a sec:authorize="hasAuthority('system:log_operate:edit')" href="javascript:void(0)" data-toggle="topjui-menubutton" data-options="
			method:'openDialog',
			extend:'#system-log_operate-list-toolbar',
			iconCls:'fa fa-pencil',
			dialog:{
				id:'system-log_operate-edit-dialog',
				title:'编辑操作日志',
				href: '/system/log_operate/edit_view/{id}',
				width:'60%',
				height:'60%',
				buttonsGroup:[{
					text:'确定',
					url:'/system/log_operate/edit',
					iconCls:'fa fa-plus',
					handler:'ajaxForm',
					btnCls:'topjui-btn-green'
				}]
			}">编辑</a>
			
		<a sec:authorize="hasAuthority('system:log_operate:info')" href="javascript:void(0)" data-toggle="topjui-menubutton" data-options="
			method:'openDialog',
			extend:'#system-log_operate-list-toolbar',
			iconCls:'fa fa-eye',
			dialog:{
				id:'system-log_operate-info-dialog',
				title:'操作日志详情',
				href: '/system/log_operate/info/{id}',
				width:'80%',
				height:'80%'
			}">查看日志详情</a>
		
		<a sec:authorize="hasAuthority('system:log_operate:delete')" href="javascript:void(0)" data-toggle="topjui-menubutton" data-options="
			method:'doAjax',
			extend:'#system-log_operate-list-toolbar',
			iconCls:'fa fa-trash',
			confirmMsg:'确认删除已选择的数据？',
			grid: {uncheckedMsg:'请先勾选要删除的数据',param:'ids:id'},
			url:'/system/log_operate/delete'">删除</a>
		
		<form sec:authorize="hasAuthority('system:log_operate:query')" id="system-log_operate-queryForm" class="search-box" style="float:right">
			<input type="text" name="label" data-toggle="topjui-textbox" data-options="id:'label',prompt:'日志标签',width:120">
			<input type="text" name="message" data-toggle="topjui-textbox" data-options="id:'message',prompt:'日志信息',width:160">
			<input type="text" name="operateType" data-toggle="topjui-combobox" data-options="id:'operateType',prompt:'操作类型',width:120,
				panelHeight:'auto',hasDownArrow:true,editable:true,
				valueField:'id',
				textField:'text',
				data: [{
				    id: 'ADD',
				    text: '新增'
				},{
				    id: 'EDIT',
				    text: '编辑'
				},{
				    id: 'DELETE',
				    text: '删除'
				},{
				    id: 'OTHERS',
				    text: '其它'
				}]">
			<input type="text" name="operatorType" data-toggle="topjui-combobox" data-options="id:'operateUserType',prompt:'操作用户类型',width:120,
				panelHeight:'auto',hasDownArrow:true,editable:true,
				valueField:'id',
				textField:'text',
				data: [{
				    id: 'MANAGE',
				    text: '后台用户'
				},{
				    id: 'MOBILE',
				    text: '手机端用户'
				},{
				    id: 'OTHERS',
				    text: '其它用户'
				}]">
			<input type="text" name="status" data-toggle="topjui-combobox" data-options="id:'status',prompt:'状态',width:100,
				panelHeight:'auto',hasDownArrow:true,editable:true,
				valueField:'id',
				textField:'text',
				data: [{
				    id: '0',
				    text: '操作成功'
				},{
				    id: '1',
				    text: '操作失败'
				}]">
			<a href="javascript:void(0)" data-toggle="topjui-menubutton" data-options="
				method:'query',
				extend:'#system-log_operate-list-toolbar',
				iconCls:'fa fa-search',
				form:{id:'system-log_operate-queryForm'},
				grid:{type:'datagrid','id':'system-log_operate-list'}">查询</a>
		</form>
	</div>
</body>
</html>